package com.coocaa.internship.util;

/**
 * @Description: 文件后缀判断util
 * @Author: zwh
 * @Date: 2019-07-29
 * @Time: 17:15
 */
public class FileSuffixUtil {
    /**
     * 合法简历文件后缀
     */
    private static String[] legalFileSuffix = {"pdf", "doc", "docx", "docm"};

    /**
     * 合法图片后缀
     */
    private static String[] legalPicSuffix = {"jpg", "png"};

    public static boolean checkFileSuffix(String originSuffix) {
        for (String suffix : legalFileSuffix) {
            if (suffix.equals(originSuffix)) {
                return true;
            }
        }
        return false;
    }

    public static boolean checkPicSuffix(String originSuffix) {
        for (String suffix : legalPicSuffix) {
            if (suffix.equals(originSuffix)) {
                return true;
            }
        }
        return false;
    }

}
